From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0116.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0111.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0109.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0109.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0109.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0109.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0108.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0102.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0105.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0105.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0105.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0103.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0097.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0117.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0112.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0110.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0110.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0110.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0110.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0109.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0103.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0106.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0106.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0106.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0104.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0098.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0118.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0113.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0111.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0111.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0111.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0111.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0110.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0105.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0107.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0107.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0107.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0105.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0099.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0119.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0114.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0112.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0112.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0112.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0112.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0111.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0106.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0108.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0108.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0108.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0106.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0100.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0120.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0115.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0113.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0113.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0113.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0113.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0112.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0107.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0109.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0109.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0109.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0107.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0101.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0121.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0116.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0114.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0114.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0114.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0114.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0113.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0108.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0110.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0110.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0110.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0108.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0102.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0122.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0117.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0115.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0115.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0115.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0115.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0114.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0109.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0111.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0111.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0111.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0109.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0103.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0123.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0118.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0116.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0116.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0116.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0116.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0115.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0110.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0112.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0112.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0112.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0110.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0104.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0124.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0119.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0117.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0117.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0117.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0117.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0116.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0111.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0113.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0113.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0113.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0111.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0105.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0125.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0120.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0118.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0118.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0118.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0118.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0117.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0112.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0114.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0114.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0114.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0112.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0106.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0001.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0001.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0001.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0001.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0001.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0001.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0001.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0001.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0001.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0001.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0001.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0001.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0001.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0002.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0002.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0002.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0002.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0002.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0002.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0002.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0002.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0002.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0002.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0002.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0002.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0002.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0003.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0003.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0003.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0003.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0003.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0003.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0003.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0003.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0003.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0003.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0003.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0003.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0003.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0004.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0004.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0004.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0004.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0004.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0004.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0004.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0004.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0004.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0004.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0004.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0004.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0004.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0005.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0005.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0005.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0005.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0005.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0005.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0005.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0005.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0005.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0005.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0005.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0005.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0005.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0006.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0006.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0006.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0006.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0006.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0006.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0006.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0006.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0006.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0006.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0006.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0006.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0006.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0007.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0007.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0007.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0007.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0007.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0007.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0007.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0007.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0007.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0007.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0007.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0007.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0007.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0008.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0008.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0008.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0008.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0008.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0008.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0008.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0008.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0008.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0008.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0008.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0008.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0008.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0009.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0009.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0009.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0009.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0009.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0009.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0009.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0009.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0009.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0009.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0009.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0009.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0009.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0010.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0010.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0010.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0010.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0010.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0010.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0010.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0010.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0010.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0010.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0010.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0010.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0010.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0001.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0001.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0001.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0001.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0001.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0001.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0001.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0001.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0001.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0001.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0001.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0001.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0001.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0002.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0002.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0002.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0002.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0002.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0002.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0002.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0002.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0002.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0002.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0002.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0002.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0002.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0003.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0003.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0003.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0003.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0003.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0003.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0003.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0003.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0003.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0003.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0003.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0003.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0003.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0004.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0004.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0004.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0004.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0004.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0004.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0004.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0004.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0004.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0004.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0004.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0004.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0004.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0005.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0005.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0005.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0005.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0005.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0005.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0005.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0005.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0005.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0005.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0005.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0005.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0005.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0006.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0006.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0006.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0006.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0006.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0006.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0006.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0006.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0006.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0006.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0006.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0006.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0006.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0007.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0007.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0007.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0007.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0007.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0007.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0007.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0007.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0007.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0007.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0007.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0007.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0007.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0008.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0008.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0008.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0008.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0008.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0008.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0008.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0008.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0008.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0008.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0008.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0008.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0008.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0009.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0009.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0009.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0009.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0009.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0009.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0009.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0009.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0009.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0009.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0009.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0009.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0009.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0010.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0010.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0010.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0010.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0010.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0010.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0010.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0010.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0010.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0010.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0010.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0010.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0010.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0001.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0001.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0001.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0001.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0001.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0001.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0001.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0001.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0001.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0001.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0001.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0001.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0001.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0002.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0002.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0002.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0002.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0002.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0002.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0002.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0002.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0002.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0002.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0002.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0002.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0002.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0003.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0003.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0003.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0003.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0003.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0003.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0003.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0003.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0003.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0003.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0003.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0003.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0003.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0004.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0004.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0004.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0004.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0004.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0004.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0004.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0004.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0004.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0004.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0004.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0004.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0004.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0005.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0005.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0005.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0005.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0005.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0005.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0005.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0005.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0005.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0005.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0005.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0005.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0005.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0006.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0006.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0006.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0006.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0006.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0006.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0006.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0006.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0006.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0006.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0006.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0006.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0006.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0007.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0007.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0007.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0007.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0007.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0007.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0007.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0007.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0007.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0007.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0007.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0007.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0007.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0008.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0008.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0008.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0008.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0008.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0008.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0008.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0008.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0008.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0008.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0008.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0008.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0008.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0009.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0009.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0009.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0009.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0009.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0009.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0009.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0009.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0009.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0009.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0009.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0009.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0009.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0010.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0010.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0010.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0010.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0010.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0010.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0010.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0010.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0010.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0010.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0010.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0010.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0010.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0011.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0011.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0011.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0011.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0011.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0011.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0011.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0011.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0011.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0011.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0011.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0011.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0011.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0012.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0012.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0012.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0012.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0012.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0012.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0012.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0012.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0012.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0012.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0012.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0012.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0012.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0013.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0013.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0013.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0013.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0013.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0013.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0013.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0013.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0013.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0013.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0013.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0013.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0013.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0014.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0014.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0014.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0014.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0014.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0014.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0014.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0014.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0014.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0014.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0014.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0014.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0014.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0015.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0015.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0015.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0015.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0015.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0015.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0015.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0015.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0015.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0015.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0015.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0015.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0015.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0016.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0016.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0016.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0016.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0016.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0016.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0016.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0016.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0016.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0016.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0016.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0016.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0016.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0017.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0017.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0017.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0017.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0017.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0017.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0017.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0017.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0017.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0017.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0017.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0017.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0017.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0018.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0018.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0018.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0018.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0018.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0018.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0018.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0018.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0018.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0018.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0018.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0018.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0018.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0019.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0019.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0019.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0019.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0019.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0019.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0019.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0019.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0019.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0019.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0019.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0019.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0019.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0020.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0020.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0020.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0020.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simple data logger: I receive information from a serial port > and > > store it with some kind of timestamp to analyse it later. However, using > > RXTX I only get something around 10 ms between readings of several > bytes, > > which is too large for me. > > > > Is there any way to decrease this time? Maybe recompiling the binaries? > > > > By the way, I'm using Windows XP. > > > > Hi Juan > > > 10 ms is about what I've observed. You could alter the source to not jump > back and forth from Java and C but thats about the latency one can expect > on Linux and Windows without tinkering. You will need to explore how much > cpu utilization you are willing to give in exchange for slightly better > times. In theory it could happen in several nano seconds but you have the > OS schedualing and Java to think about which makes the 10 ms fairly > reasonable. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/dc08b852/attachment-0020.html From Martin.Oberhuber at windriver.com Fri Feb 9 06:36:39 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 14:36:39 +0100 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> When RXTX-2.1r2 is first loaded, it prints the following to stdout: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 In May 2005, there was a thread about this, arguing why the diagnostic is there but also asking for a way to disable the message: http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html I found that the patch from that E-Mail has been applied to the commapi-0-0-1 branch but not been merged to HEAD yet. Is this intentional? I think it's important for vendors who embed RXTX in their commercial products to be able and get rid of this diagnostic message. Because of that, we're also tracking this issue on Eclipse Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 Can we assume that this is going to be fixed for the next RXTX version? When can we expect the next RXTX version to appear? BTW, in order to allow debugging deployed products, I think it would be a good idea to be do private final static boolean debug = "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); Similarly, Linux folks on a 2.6 Kernel with UDEV might want to be able and enumerate all their ports when a System Property is set: private final static boolean allPorts = "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/a047d3e7/attachment-0020.html From Martin.Oberhuber at windriver.com Fri Feb 9 07:22:51 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 9 Feb 2007 15:22:51 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Hi all, I know that the issue of lock files has been discussed quite a bit, but searching through the mail archives I didn't quite find out what the current status of this is. I also checked the CVS / ChangeLog and CVS / INSTALL, and it looks like lockfiles are gone on Mac OSX but not yet on Linux. So please apologize if I'm asking something well-known again... could anybody give me a current status on the following? We have Eclipse Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 open with the following suggestions (see the link for full description): 1. RXTX should have an option for disabling lockfiles at runtime, without having to recompile. Either via a System Property, or via some API. Some users don't have "root" access, just need to get going and dont care about lockfiles. Commercial applications which embed RXTX need to make sure their products can actually be used. 2. In the error message printed by RXTX, the following information should be added: 3a) Path of the file that RXTX tried to create -- knowing it was below /var/lock would have made it a lot easier for me to fix it 3b) If (1) is done, information how to set the System Property for disabling lockfiles 3. RXTX INSTALL should be more explicit about having to add to group "lock" instead of "uucp" on modern Redhat Linux. 4. If there is a modern Linux Standard for locking devices (from normal user permissions, without fixing any group ids!) this standard should be used. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070209/7b92c15d/attachment-0020.html From tjarvi at qbang.org Fri Feb 9 19:04:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:04:35 -0700 (MST) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4AA@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > When RXTX-2.1r2 is first loaded, it prints the following to stdout: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > In May 2005, there was a thread about this, arguing why the diagnostic > is there > but also asking for a way to disable the message: > > http://mailman.qbang.org/pipermail/rxtx/Week-of-Mon-20060515/794350.html > > I found that the patch from that E-Mail has been applied to the > commapi-0-0-1 > branch but not been merged to HEAD yet. Is this intentional? No. It was an oversight. We can add these changes. The intent of defaulting to the messages is to get debug info to the list right away for people tinkering. They often mix versions before thinking through a problem. If a product has it's own support, they should be able to disable the message without recompiling. > > I think it's important for vendors who embed RXTX in their commercial > products to be able and get rid of this diagnostic message. Because of > that, we're also tracking this issue on Eclipse Bugzilla: > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173629 There is also the YACK macro in win32termios.h that you may want to silence in production code. I've been involved with rxtx in a commercial product for several years and just patched it. If you want to use rxtx.org as a source of the binaries, you may want to come up with a like solution for YACK. Its a macro so it may require some extra thought. > > Can we assume that this is going to be fixed for the next RXTX version? > When can we expect the next RXTX version to appear? I want to announce the next release of rxtx on March 10th. Thats the 10 year anniversary of rxtx. But it may be available for download sooner. I'm just getting to rxtx at work during our usual devel cycle. I've just got the legal OK, code review, .. for everything thats [already] going to be in. > > BTW, in order to allow debugging deployed products, > I think it would be a good idea to be do > private final static boolean debug = > "true".equals(System.getProperty("gnu.io.rxtx.DEBUG")); sigh. The debug code was never really designed to be useful in a generic sense. Some of the native debug code is wildly dangerous when enabled. Have you thought about what you would actually like to see? The way the code got there is rxtx was put up against a formidable test suite. The suite is in an unusual environment from the open source perspective but the use of it for testing code changes for the community is an ongoing dicussion that may happen. Perhaps a batch submision process. The debug messages are more of a track I left while fixing issues the test suite picked up then a generic effort to provide useful information. It would be great to replace the current test suite with an open source community effort. What rxtx has now [behind the scenes] is hard to maintain, almost impossible to share for technical [and maybe IP] reasons and really not something any company wants to maintain. Testing the 'low' level interfaces is not what that type of test was for. I suspect you see like material at your workplace. If you have not guessed by now, rxtx is used in large commercial applications. But rxtx.org was intended to be a source dump shared between organizations initially. There was never a well formed effort to provide binaries on rxtx.org. Thats the really new part. I understand that may be required for licensing reasons and can probably help out with rxtx.org. Still, it may not hurt to rethink if rxtx.org should be the place people get binaries. > > Similarly, Linux folks on a 2.6 Kernel with UDEV might want to > be able and enumerate all their ports when a System Property is set: > > private final static boolean allPorts = > "true".equals(System.getProperty("gnu.io.rxtx.ALL_PORTS")); This makes sense now. They already burned a hole in their motherboard trying to start udev after purchasing another 64 megs ram. They should get some benefits :) > > > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > From tjarvi at qbang.org Fri Feb 9 19:08:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 9 Feb 2007 19:08:32 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C4E5@ism-mail03.corp.ad.wrs.com> Message-ID: On Fri, 9 Feb 2007, Oberhuber, Martin wrote: > Hi all, > > I know that the issue of lock files has been discussed quite a bit, > but searching through the mail archives I didn't quite find out what > the current status of this is. > > I also checked the CVS / ChangeLog and CVS / INSTALL, and > it looks like lockfiles are gone on Mac OSX but not yet on Linux. > So please apologize if I'm asking something well-known again... > could anybody give me a current status on the following? > > We have Eclipse Bug > https://bugs.eclipse.org/bugs/show_bug.cgi?id=173642 > open with the following suggestions (see the link for full description): > 1. RXTX should have an option for disabling lockfiles at runtime, > without > having to recompile. Either via a System Property, or via some API. > Some users don't have "root" access, just need to get going and dont > care about lockfiles. Commercial applications which embed RXTX need > to > make sure their products can actually be used. > 2. In the error message printed by RXTX, the following information > should be > added: > 3a) Path of the file that RXTX tried to create -- knowing it was > below > /var/lock would have made it a lot easier for me to fix it > 3b) If (1) is done, information how to set the System Property for > disabling > lockfiles > > 3. RXTX INSTALL should be more explicit about having to add to group > "lock" > instead of "uucp" on modern Redhat Linux. > > 4. If there is a modern Linux Standard for locking devices (from normal > user > permissions, without fixing any group ids!) this standard should be > used. > > FYI 4 is what I'm looking at this time around. This is actually the first time I'll have access to all the OS's. Truth is, the lock files are disabled in shipping products. It's ugly. -- Trent Jarvi tjarvi at qbang.org From alwyn.schoeman at gmail.com Sat Feb 10 01:34:42 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Sat, 10 Feb 2007 10:34:42 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Thanks Trent, You've put me on the right track. I currently need to send a message to the modem that consists of a command terminated with a 0x0d. Then I need to send some text followed by ^z. Should I follow the ^z with a 0x0d again or should it work as is? On 2/9/07, Trent Jarvi wrote: > > On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > > > Hi everyone, > > > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up > the > > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > > > I have modified the source code so that this port is recognized and used > as > > a serial port. > > > > Using minicom it works without problem. > > > > I've tried communicating with it using both Java (rxtx version 2.1) and > > python. In both scenarios I get the same result and I think I'm just > doing > > something wrong. > > When using rxtx I am using the one example on your site > (TwoWaySerialComms). > > > > I enter the data and send it to the serial device. The data I send > echoes > > back. I'm not sure if I'm reading it or if it is the library. This is > > strange as I am quite sure that all > > echo settings are turned off. > > > > Then after a considerable time, an ERROR is returned from the > device. It is > > as if it has either received garbage or timed out waiting for a complete > > command. > > > > Anyone please put me on the right path? > > > > > > Hi Alwyn > > You may look in the contrib directory that comes with the rxtx source for > some example modem control examples. SimpleSnuV1.java is an example that > gets the right responses from atz for instance. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070210/53f9e1b4/attachment-0020.html From lyon at docjava.com Sat Feb 10 04:34:39 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 10 Feb 2007 06:34:39 -0500 Subject: [Rxtx] lego In-Reply-To: <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: Hi All, Is anyone using RXTX to control lego mindstorm? It seems somehow wed to the old javax.comm package. Thanks! - DL From tjarvi at qbang.org Sat Feb 10 11:02:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:02:14 -0700 (MST) Subject: [Rxtx] lego In-Reply-To: References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> <22d55aea0702100034o3bcf42f3j1d1a6257029a67b0@mail.gmail.com> Message-ID: On Sat, 10 Feb 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone using RXTX to control lego mindstorm? > It seems somehow wed to the old javax.comm package. > Thanks! Hi Doug I thought the current mindstorm moved away from serial. Are you looking at the older version? I had not looked close but I thought they used a USB device and partnered with NI for the latest version. Mindstorm is certainly something of interest to rxtx.org users. If there is something we can do, I'd love to help. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 10 11:35:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Feb 2007 11:35:06 -0700 (MST) Subject: [Rxtx] QBang.org outage. Message-ID: qbang was down yesterday afternoon. This is most of the rxtx.org infrastructure until we move it to a colo. It only has about a 30 min backup power supply and the electric company needed 2.5 hours to move a main. We just shut it down. http://www.qbang.org/qbang/ -- Trent Jarvi tjarvi at qbang.org From fredm at alum.mit.edu Sun Feb 11 12:22:54 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Sun, 11 Feb 2007 14:22:54 -0500 Subject: [Rxtx] Mactel assistance, please Message-ID: <4BE9AE16-435A-402F-B084-1B620E1C18BC@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on the Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: I have the same stuff on both machines. The librxtxSerial.jnilib file is 326,432 bytes and has a timestamp of Feb 21, 2006. Can anyone shed light on this? Do I simply need a version of the .jnilib file that's compiled for Intel? Thanks all, Fred From Martin.Oberhuber at windriver.com Mon Feb 12 09:05:37 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 12 Feb 2007 17:05:37 +0100 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> > > 4. If there is a modern Linux Standard for locking devices > > (from normal user permissions, without fixing any group ids!) > > this standard should be used. > 4 is what I'm looking at this time around. This is actually > the first > time I'll have access to all the OS's. It's great that you're trying to improve the locking. However, experience shows that there is always a scenario which isn't covered properly. Thus, maintainers of commercial products should have a chance to a) Diagnose the issue, and b) Switch off locking without recompiling when needed. Therefore, please, work on (1) and (2a) as well - and let the Community know if you want some help on these: > > 1. RXTX should have an option for disabling lockfiles at runtime, > > without having to recompile. Either via a System Property (e.g. > > -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > > 2. In the error message printed by RXTX, the following information > > should be added: > > 2a) Path of the file that RXTX tried to create -- knowing it was > > below /var/lock would have made it a lot easier for me to fix it Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From jason.price at novatech.co.uk Mon Feb 12 10:48:08 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Mon, 12 Feb 2007 17:48:08 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28E01@ethel2.novatech.co.uk> Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070212/734c1bba/attachment-0020.html From tjarvi at qbang.org Mon Feb 12 21:53:45 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Feb 2007 21:53:45 -0700 (MST) Subject: [Rxtx] Improvements for lock files on Linux? In-Reply-To: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584895C8F8@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 12 Feb 2007, Oberhuber, Martin wrote: >>> 4. If there is a modern Linux Standard for locking devices >>> (from normal user permissions, without fixing any group ids!) >>> this standard should be used. > >> 4 is what I'm looking at this time around. This is actually >> the first >> time I'll have access to all the OS's. > > It's great that you're trying to improve the locking. > However, experience shows that there is always a scenario > which isn't covered properly. Thus, maintainers of commercial > products should have a chance to > a) Diagnose the issue, and > b) Switch off locking without recompiling when needed. > > Therefore, please, work on (1) and (2a) as well - and let the > Community know if you want some help on these: > >>> 1. RXTX should have an option for disabling lockfiles at runtime, >>> without having to recompile. Either via a System Property (e.g. >>> -vmargs -Dgnu.io.rxtx.LOCKFILES=false), or via some API. > >>> 2. In the error message printed by RXTX, the following information >>> should be added: >>> 2a) Path of the file that RXTX tried to create -- knowing it was >>> below /var/lock would have made it a lot easier for me to fix it > Hi Martin You are free to implement the other options as well and they will be accepted. I'm not planning on looking at them. What Mac OS X does is actually available on other Unix and Unix like systems via their APIs. We just didnt use it in the past mainly due to ignorance of its availability. Was there a reason for all the duplicate posts that I should look into? -- Trent Jarvi tjarvi at qbang.org From Pawan.Kharbanda at dot.state.co.us Mon Feb 12 22:16:48 2007 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Mon, 12 Feb 2007 22:16:48 -0700 Subject: [Rxtx] Improvements for lock files on Linux? Message-ID: <939A619A756047469C41EE9BA51890FB0545B4D3@hqexchange3.dot.state.co.us> Trent, After reading that you will be working on improving lock files on Linux. I would like to add that please look at the locking from the prespective of multiple comm ports being accessed by the application. I still see some port locks on my system but not as frequently as it used to be in the past. As you might remember we open and close lots of Serial Ports very frequently through our application and run into issue of port locking over the period of time. Let me know if I can help either with code or testing. I can definitely help test the new functionality as I have resources to simulate the port lockings in Red Hat Linux. Regards Pawan Kharbanda From jason.price at novatech.co.uk Tue Feb 13 05:29:51 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:29:51 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F27@ethel2.novatech.co.uk> Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/6c81277a/attachment-0020.html From jason.price at novatech.co.uk Tue Feb 13 05:52:04 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Tue, 13 Feb 2007 12:52:04 -0000 Subject: [Rxtx] Not receiving data on linux Message-ID: <01781BBBF0456F4AB2963F3AF74B914503D28F40@ethel2.novatech.co.uk> Actually it was the modem the lead had come out of the back slightly since plugging it in it all seems to work as expected, weird though.. _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 13 February 2007 12:30 To: RXTX Developers and Users Subject: Re: [Rxtx] Not receiving data on linux Hi I've managed to get further with this: for some reason if I run the code from within eclipse on Linux then the outputstream is null. If I run it from the command line its works. However when I send a command, say ATZ, to the modem the response I get through the input stream is "ATZ\r\r\rOK\r" is this normal behaviour on Linux? I don't think its the modem as if I use minicom then everything is working as expected (and setting echo on or off has no effect). Also with windows I was using (data=is.read())>0 in a while loop to buffer the response but it never completes on Linux and I have to use is.available() instead again is this default Linux behaviour? thanks in advance Jason Price _____ From: Jason Price [mailto:jason.price at novatech.co.uk] Sent: 12 February 2007 17:48 To: RXTX Developers and Users Subject: [Rxtx] Not receiving data on linux Hi I have a class that sends commands to a modem and reads the responses. This works fine on windows xp but I cannot get the same code to work on linux (Ubuntu 6.10 server). I open the port as follows while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(portname)) { try { console("opening " + portname); serialPort = (SerialPort) portId.open("SerialX25Host",2000); serialPort.setSerialPortParams(115200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnOutputEmpty(true); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); is = serialPort.getInputStream(); console("opened " + portname); state = MODEM_OPEN; readThread = new Thread(this); readThread.setDaemon(true); readThread.start(); } catch (Exception e) { listener.error("Cannot open serial Port", e); e.printStackTrace(); } } } } portName is set to COM1 on windows and /dev/ttyS0 on linux. The thread I kick off when the prot is onpen just reads from the inputstream when data is available using the following case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer buffer = new StringBuffer(); byte[] byteBuffer = new byte[1024]; // buffer 1k bytes int data = 0, pos = 0; while ((data = is.read()) > 0) { byteBuffer[pos] = (byte) data; pos++; if (pos >= 1024) { // add to stringbuffer buffer.append(new String(byteBuffer)); pos = 0; byteBuffer = new byte[1024]; } } buffer.append(new String(byteBuffer)); processResponse(buffer.toString().trim()); } catch (IOException e) { listener.error("Error receiving data: ", e); e.printStackTrace(); } break; the porblem I have is that although this works on xp fine when I run it under linux (using same modem and hardware, the machine dual boots) I send a command (i.e. ATZ) and nothing is ever read. I am running the program as root so group permissions should'nt be a problem! Anyone got any ideas regards Jason Price Development Team Novatech Ltd t: 02392 322733 f: 02392 322533 e: jason.price at novatech.com w: http://www.novatech.com This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Novatech. Unauthorised publication, use, dissemination, forwarding, printing or copying of this e-mail and any associated attachments is strictly prohibited. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. Novatech Ltd. Registered in England. Number 2605046. Harbour House, Hamilton Road, Cosham, Portsmouth, Hants, PO6 4PU. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070213/b40ab93c/attachment-0020.html From fredm at alum.mit.edu Wed Feb 14 09:52:36 2007 From: fredm at alum.mit.edu (Fred G. Martin) Date: Wed, 14 Feb 2007 11:52:36 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... Message-ID: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Hi everyone. I'm trying to get RXTX running on my Intel Mac with OS 10.4.8. I am using RXTX 2.1-7r2. I have installed the Feb 21, 2006 versions of RXTXcomm.jar and librxtxSerial.jnilib. I have a simple test program. It basically enumerates the serial ports, and then if it finds any, tries to open them, closes them, and then prints out the results. (A copy is available at www.cs.uml.edu/ ~fredm/tmp/SerialTest.zip) The test code works fine on a PPC Mac and some Intel Macs. Here is sample output: $ java SerialTest Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LK.001.009.000 Available ports are: /dev/tty.modem /dev/cu.modem When I try it on my Intel Mac, I get the following: $ java SerialTest Experimental: JNI_OnLoad called. java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver no SPs available! Available ports are: HERE IS THE WEIRD THING. On some Intel Macs, this setup works properly. On others not -- we get the "nativeGetVersion" exception. Does anyone have any suggestions on for what to look for? Thank you, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070214/401ff164/attachment-0020.html From ajmas at sympatico.ca Fri Feb 16 15:42:21 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri, 16 Feb 2007 17:42:21 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> Message-ID: <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: > > When I try it on my Intel Mac, I get the following: > > $ java SerialTest > Experimental: JNI_OnLoad called. > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while > loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading > gnu.io.RXTXCommDriver > no SPs available! > Available ports are: > > > > HERE IS THE WEIRD THING. On some Intel Macs, this setup works > properly. On others not -- we get the "nativeGetVersion" exception. > > Does anyone have any suggestions on for what to look for? > Soounds like some dependency is missing. Check that yours paths are correct or that the libs are in the default search path for the Java VM, that is for both the Java JARs and the native libs. Are they all the same system version and Java version? Andre From tjarvi at qbang.org Mon Feb 19 13:24:00 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Feb 2007 13:24:00 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal Message-ID: The following is what I would like to include in all versions of rxtx. We need a link that explains the license for Eclipse users as part of their process. Rather than try to do two links for rxtx depending upon which version, I propose to use the following for both in the future. The heart of the change is that people can link to rxtx through controlled interfaces. This allows people to use rxtx with commapi from Sun. As the current Sun API broke this arangement, I propose we limit the license to version 2 of Sun's CommAPI until a JSR or other solution is available. Version 3 will not work with rxtx anyhow. Why the exception? Some lawyers think the GNU LGPL does not clearly allow users to do what the exception allows [link through controlled interfaces]. The exception is to make the intent clear; Go ahead. To keep your life simple as you review this, nothing is changed outside the box. The exception is within the box [ /*---------- ] and is the solution GNU recommends for this type of solution. If anyone has objections, please bring them up on the list. No new licensing is to be considered at this time; just the consolidation of the current licenses. Copyright attributions in individual files will not change if someone made significant contributions to a file. Those individuals are not losing any rights. There is no intent to go to LGPL 3 but the license allows others to do so [we won't modify that right]. And now for the license ... /*------------------------------------------------------------------------- | RXTX License v 2.1 - LGPL + Linking Over Controled Interface. | rxtx is a native interface to serial ports in java. | Copyright 1997-2007 by Trent Jarvi tjarvi at qbang.org | | This library is free software; you can redistribute it and/or | modify it under the terms of the GNU Lesser General Public | License as published by the Free Software Foundation; either | version 2.1 of the License, or (at your option) any later version. | | This library is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | Lesser General Public License for more details. | | The following has been added to the RXTX License to remove | any confusion about linking to rxtx. | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface | | A program that contains no derivative of any portion of RXTX, but | is designed to work with RXTX by being compiled or linked with it, | is considered a "work that uses the Library" subject to the terms and | conditions of the GNU Lesser General Public License. | | As a special exception, the copyright holders of RXTX give you | permission to link RXTX with independent modules that communicate with | RXTX solely through the Sun Microsytems CommAPI interface version 2, | regardless of the license terms of these independent modules, and to copy | and distribute the resulting combined work under terms of your choice, | provided that every copy of the combined work is accompanied by a complete | copy of the source code of RXTX (the version of RXTX used to produce the | combined work), being distributed under the terms of the GNU Lesser General | Public License plus this exception. An independent module is a | module which is not derived from or based on RXTX. | | Note that people who make modified versions of RXTX are not obligated | to grant this special exception for their modified versions; it is | their choice whether to do so. The GNU Lesser General Public License | gives permission to release a modified version without this exception; this | exception also makes it possible to release a modified version which | carries forward this exception. | | You should have received a copy of the GNU Lesser General Public | License along with this library; if not, write to the Free | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------*/ The original GNU Lesser General Public License Follows. GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! From Martin.Oberhuber at windriver.com Tue Feb 20 05:06:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 20 Feb 2007 13:06:59 +0100 Subject: [Rxtx] RXTX consolidated license proposal Message-ID: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Hi Trent, thanks for consolidating the licenses. Here are some initial comments: * Line #1 - Typo - shouldn't it be "controlled interfaces" instead of "controled" * Line #2, #13 - rxtx - All the rest of the license uses RXTX capitalized, I believe this should be consistent. Also, I think that the term "Java" should be capitalized and might need a (TM) suffix to make Sun happy. * Line #3 - Copyright - Aren't there other contributors in all of RXTX too? I'd be more comfortable with: "Copyright 1997-2007 by RXTX contributors" or "Trent Jarvi and RXTX contributors". * Line #7 - LGPL Reference - Would it be possible to add an URL pointing to the LGPL version 2.1 on the Internet? - Also, you reference LGPL 2.1, but the copy of LGPL below states "Version 2, June 1991" * Line #15ff - static vs. dynamic linking - you did not transcribe the text from the "controlled interface exception" when writing this text - and this was good so, because these terms originally refer to the GPL rather than the LGPL. I think though, that these 4 lines are the most important ones and should thus be really really clear. I hope that I meet your original intent with the following suggestions: 1.) Instead of "A program.." it would be better to say "An exectuable.." in order to be closer to the LGPL text. 2.) It would be better to say .. "by being dynamically linked with it" to clearly indicate that dynamic linking is meant. The matter of compilation is already covered by the LGPL so mentioning it again just leads to confusion. 3.) It would be better to say .. "is considered a work that uses the library in contrast to section 5 of the LGPL, so the terms of the LGPL do not apply to the resulting executable". Note that LGPL section 5 says: ..."is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License." The next paragraph of the LGPL is exactly the problematic one that I hope is clarified by the exception terms you give. * Line #21 - Not sure if you need a (TM) mark for the term "Sun" * You reference the "GNU Lesser General Public License" but the verbatim copy below titles it the "GNU Library General Public License". I believe these should be consistent. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Tue Feb 20 05:45:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Feb 2007 05:45:02 -0700 (MST) Subject: [Rxtx] RXTX consolidated license proposal In-Reply-To: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848AB94AA@ism-mail03.corp.ad.wrs.com> Message-ID: Hi Martin, I'll put up another copy that addresses most of these concerns tonight and explain the differences with the others. I don't think there is anything that problematic while reading through your comments. On Tue, 20 Feb 2007, Oberhuber, Martin wrote: > Hi Trent, > > thanks for consolidating the licenses. > Here are some initial comments: > > * Line #1 - Typo - shouldn't it be "controlled interfaces" > instead of "controled" > > * Line #2, #13 - rxtx - All the rest of the license uses > RXTX capitalized, I believe this should be consistent. > Also, I think that the term "Java" should be capitalized > and might need a (TM) suffix to make Sun happy. > > * Line #3 - Copyright - Aren't there other contributors > in all of RXTX too? I'd be more comfortable with: > "Copyright 1997-2007 by RXTX contributors" > or "Trent Jarvi and RXTX contributors". > > * Line #7 - LGPL Reference - Would it be possible to > add an URL pointing to the LGPL version 2.1 on the > Internet? - Also, you reference LGPL 2.1, but the > copy of LGPL below states "Version 2, June 1991" > > * Line #15ff - static vs. dynamic linking - you did > not transcribe the text from the "controlled > interface exception" when writing this text - and > this was good so, because these terms originally > refer to the GPL rather than the LGPL. I think though, > that these 4 lines are the most important ones and > should thus be really really clear. I hope that I > meet your original intent with the following > suggestions: > 1.) Instead of "A program.." it would be better to > say "An exectuable.." in order to be closer to > the LGPL text. > 2.) It would be better to say .. "by being dynamically > linked with it" to clearly indicate that dynamic > linking is meant. The matter of compilation is > already covered by the LGPL so mentioning it again > just leads to confusion. > 3.) It would be better to say .. "is considered a > work that uses the library in contrast to section > 5 of the LGPL, so the terms of the LGPL do not > apply to the resulting executable". > > Note that LGPL section 5 says: ..."is called a > "work that uses the Library". Such a work, in isolation, > is not a derivative work of the Library, and therefore > falls outside the scope of this License." > The next paragraph of the LGPL is exactly the problematic > one that I hope is clarified by the exception terms you > give. > > * Line #21 - Not sure if you need a (TM) mark for > the term "Sun" > > * You reference the "GNU Lesser General Public License" > but the verbatim copy below titles it the "GNU > Library General Public License". I believe these > should be consistent. > > Thanks, > -- > Martin Oberhuber > Wind River Systems, Inc. > Target Management Project Lead, DSDP PMC Member > http://www.eclipse.org/dsdp/tm > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ctron at dentrassi.de Wed Feb 21 04:02:38 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Wed, 21 Feb 2007 12:02:38 +0100 Subject: [Rxtx] possible multithreading issue Message-ID: <1172055758.5431.5.camel@wintermute> Hi, I'm currently trying to control a lego mindstorms nxt using rxtx over bluetooth (using /dev/rfcomm0). It all works fine unless I start using a multithreaded application. When I open the port I get the following exception: gnu.io.PortInUseException: jens PID = 1151 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) at org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) at org.openscada.mindstorms.nxt.da.server.Connection $3.run(Connection.java:186) at java.lang.Thread.run(Thread.java:595) Although I am _really_ sure there is no second application which has the port open. Also the user, PID and application point the this application itself. If works if it is started from the main thread. I'm using the rxtx version bundled with ubuntu 6.10. I hope someone can help thanks in advance jens -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070221/1d1669f2/attachment-0020.bin From tjarvi at qbang.org Wed Feb 21 17:45:28 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Feb 2007 17:45:28 -0700 (MST) Subject: [Rxtx] possible multithreading issue In-Reply-To: <1172055758.5431.5.camel@wintermute> References: <1172055758.5431.5.camel@wintermute> Message-ID: On Wed, 21 Feb 2007, Jens Reimann wrote: > Hi, > > I'm currently trying to control a lego mindstorms nxt using rxtx over > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > multithreaded application. When I open the port I get the following > exception: > > gnu.io.PortInUseException: jens PID = 1151 Program = java > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > at > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > at > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > at org.openscada.mindstorms.nxt.da.server.Connection > $3.run(Connection.java:186) > at java.lang.Thread.run(Thread.java:595) > > Although I am _really_ sure there is no second application which has the > port open. Also the user, PID and application point the this application > itself. If works if it is started from the main thread. > > I'm using the rxtx version bundled with ubuntu 6.10. > > I hope someone can help > > thanks in advance > Hi Jens Is it possible a thread is opening the port but not closing it? That would leave a lockfile suggesting the port is in use. You can test if it is lockfiles by configuring rxtx with configure --disable-lockfiles and recompiling. -- Trent Jarvi tjarvi at qbang.org From ctron at dentrassi.de Thu Feb 22 03:07:04 2007 From: ctron at dentrassi.de (Jens Reimann) Date: Thu, 22 Feb 2007 11:07:04 +0100 Subject: [Rxtx] possible multithreading issue In-Reply-To: References: <1172055758.5431.5.camel@wintermute> Message-ID: <1172138824.11766.3.camel@wintermute> On Wed, 2007-02-21 at 17:45 -0700, Trent Jarvi wrote: > On Wed, 21 Feb 2007, Jens Reimann wrote: > > > Hi, > > > > I'm currently trying to control a lego mindstorms nxt using rxtx over > > bluetooth (using /dev/rfcomm0). It all works fine unless I start using a > > multithreaded application. When I open the port I get the following > > exception: > > > > gnu.io.PortInUseException: jens PID = 1151 Program = java > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > at > > org.openscada.mindstorms.nxt.base.Connection.connect(Connection.java:50) > > at > > org.openscada.mindstorms.nxt.da.server.Connection.performConnect(Connection.java:205) > > at org.openscada.mindstorms.nxt.da.server.Connection > > $3.run(Connection.java:186) > > at java.lang.Thread.run(Thread.java:595) > > > > Although I am _really_ sure there is no second application which has the > > port open. Also the user, PID and application point the this application > > itself. If works if it is started from the main thread. > > > > I'm using the rxtx version bundled with ubuntu 6.10. > > > > I hope someone can help > > > > thanks in advance > > > > Hi Jens > > Is it possible a thread is opening the port but not closing it? That > would leave a lockfile suggesting the port is in use. You can test if it > is lockfiles by configuring rxtx with configure --disable-lockfiles and > recompiling. Hi, I'm sorry that is not it. I checked (using the command rfcomm) that the port is detached. I then start the application which forks the thread, which then immediately opens the COM port. Then I get the problem immediately. I compiled a version myself with the --disable-lockfiles which works perfectly. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ctron at dentrassi.de - ICQ: 119027938 - GPG Key ID: C947C120 GPG Fingerprint: CE43 9751 8AE1 0186 A566 C868 997A 4DF8 C947 C120 From Paul.Klissner at Sun.COM Thu Feb 22 16:25:52 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:25:52 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values Message-ID: <45DE2680.80200@sun.com> I'm curious about the differences in the implementation of PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer isn't too obvious due to documentation I missed or a previous discussion on this list. We've noticed a discrepancy between the SCARD_* constants to define SCardStatus() values returned from WinSCard.lib (a library provided for SmartCard development with MicroSoft SDK) and the values from pcsclite.h: pcsclite: #define SCARD_PRESENT 0x0004 #define SCARD_ABSENT 0x0002 #define SCARD_SPECIFIC 0x0040 Windows SDK,(include/WinSmcrd.h) #define SCARD_PRESENT 0x0002 #define SCARD_ABSENT 0x0001 #define SCARD_SPECIFIC 0x0006 pcsclite constants have the values expressed as bit masks. The SDK defines them as bit offsets. (ie. they have a simple algebraic relationship to one another). The Windows documentation indicates that SCardStatus() will return one among several values: http://msdn2.microsoft.com/en-gb/library/aa379803.aspx which implies a hierarchy wherein one state implies other states. A windows app. linked against WinSCard.lib from the SDK bears out the Windows documentation. For example, SCardStatus() returns 0x0006 when a card is inserted in the reader, corresponding to SCARD_SPECIFIC. The PC/SC lite documentation is different: http://pcsclite.alioth.debian.org/pcsc-lite/node19.html It indicates the card state values are logically ORed, and I confirmed wthat by running testpcsc on Solaris, using the same SmartCard inserted in the reader as in the test above, where the value 0x34 was returned, which as a combination of the following states: SCARD_PRESENT SCARD_NEGOTIABLE SCARD_POWERED Why did PC/SC lite decide to go this route? It does seem in some ways more useful or intuitive, but doesn't it work against application portability? Should the difference be documented? I wonder how many developers have had confusion or problems with this? Can anyone offer some insights or background on this? I'm not familiar enough with the differences between PCSClite and PC/SC to know how compatible and portable they were intended to be. Thanks, Paul From Paul.Klissner at Sun.COM Thu Feb 22 16:29:49 2007 From: Paul.Klissner at Sun.COM (Paul Klissner) Date: Thu, 22 Feb 2007 15:29:49 -0800 Subject: [Rxtx] Windows vs. PC/SC Lite SCardStatus() status values In-Reply-To: <45DE2680.80200@sun.com> References: <45DE2680.80200@sun.com> Message-ID: <45DE276D.8060106@sun.com> Sorry, sent this to the wrong list 8-} Nevermind :) Paul Paul Klissner wrote: > I'm curious about the differences in the implementation of > PC/SC Lite SCardStatus vs. Windows PC/SC. Hopefully the answer > isn't too obvious due to documentation I missed or a previous > discussion on this list. > > We've noticed a discrepancy between the SCARD_* constants > to define SCardStatus() values returned from WinSCard.lib > (a library provided for SmartCard development with MicroSoft SDK) > and the values from pcsclite.h: > > pcsclite: > #define SCARD_PRESENT 0x0004 > #define SCARD_ABSENT 0x0002 > #define SCARD_SPECIFIC 0x0040 > > Windows SDK,(include/WinSmcrd.h) > #define SCARD_PRESENT 0x0002 > #define SCARD_ABSENT 0x0001 > #define SCARD_SPECIFIC 0x0006 > > > pcsclite constants have the values expressed as bit masks. > The SDK defines them as bit offsets. (ie. they have > a simple algebraic relationship to one another). > > The Windows documentation indicates that SCardStatus() > will return one among several values: > http://msdn2.microsoft.com/en-gb/library/aa379803.aspx > which implies a hierarchy wherein one state implies other > states. > > A windows app. linked against WinSCard.lib from the SDK bears > out the Windows documentation. For example, SCardStatus() > returns 0x0006 when a card is inserted in the reader, corresponding > to SCARD_SPECIFIC. > > The PC/SC lite documentation is different: > http://pcsclite.alioth.debian.org/pcsc-lite/node19.html > It indicates the card state values are logically ORed, and I confirmed > wthat by running testpcsc on Solaris, using the same SmartCard inserted > in the reader as in the test above, where the value 0x34 was returned, > which as a combination of the following states: > > SCARD_PRESENT > SCARD_NEGOTIABLE > SCARD_POWERED > > Why did PC/SC lite decide to go this route? It does seem in some ways > more useful or intuitive, but doesn't it work against application > portability? Should the difference be documented? I wonder how many > developers > have had confusion or problems with this? Can anyone offer some insights > or background on this? > > I'm not familiar enough with the differences between PCSClite and > PC/SC to > know how compatible and portable they were intended to be. > > Thanks, > Paul > > -- Paul.Klissner at sun.com Sun Ray Product Engineering I don't speak for my employer. My opinions are not necessarily those of Sun Microsystems, Inc. or any of its wholly-owned subsidiaries. From ajmas at sympatico.ca Mon Feb 26 14:52:26 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 26 Feb 2007 16:52:26 -0500 Subject: [Rxtx] weird Intel Mac problem -- works on some, not others... In-Reply-To: References: <14161F3B-E84A-4DCB-8DFA-367A426890C5@alum.mit.edu> <71A8048B-5713-4711-99AD-B753F1B6ACD7@sympatico.ca> Message-ID: <4451B902-2E9E-4752-84E6-6497F7157236@sympatico.ca> With regards to the lock files, I would highly recommend using the source code in CVS, which does away with the whole notion of lock files, at least for MacOS X. Something else to watch out for is that you will be given a 'PortInUseException' if your Bluetooth device has been paired (a /dev/tty device exists for it), but is not currently active. I wouldn't be surprised if having Bluetooth turned off on the Mac side would give the same issues. This is a gotcha that had me stumped for a while. Andre On 23-Feb-07, at 15:38 , Arthur Lewis wrote: > Thanks, Andre. Both machines on my end (one Core Duo MacBook, and > one Mac Mini) are running 10.4.8, with Java 2 RE build > 1.5.0_06-112. The classpath includes /Library/Java, and > RXTXcomm.jar and librxtxserial.jnilib are in Library/Java/ > Extensions. The MacBook recognizes the libraries, the Mini gets the > message Fred mentioned. > > However, the Macbook seems to have developed some problems since > Fred's e-mail. Specifically, it is throwing > gnu.io.PortInUseExceptions. I had this problem earlier, and fixed > it by making sure I was a member of uucp, and setting /var/lock's > permissions to root:uucp 775. But the permissions have not > changed, and the problem has returned. > > I've just transferred the two library files from the older Macbook > over to a newer Core 2 Duo Macbook with 10.4.8, and a newer Java > build (1.5.0_07-164) The newer machine has the same permissions, > file locations, and problems as the older MacBook. > > Here is the output from the newer Macbook: > > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.000 > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.002 > gnu.io.PortInUseException: Unknown Application > RXTX Warning: Removing stale lock file. /var/lock/LK.002.010.003 > gnu.io.PortInUseException: Unknown Application > Available ports are: > /dev/tty.Bluetooth-PDA-Sync > /dev/cu.Bluetooth-PDA-Sync > > Any thoughts on the reappearance of this problem, or other insights > on the older one? Does anyone know how to determine what "Unknown > Application" is "using" the ports? > > Thanks, > > Arthur > > > On Feb 16, 2007, at 5:42 PM, Andre-John Mas wrote: > >> >> On 14-Feb-07, at 11:52 , Fred G. Martin wrote: >> >>> >>> When I try it on my Intel Mac, I get the following: >>> >>> $ java SerialTest >>> Experimental: JNI_OnLoad called. >>> java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while >>> loading gnu.io.RXTXCommDriver >>> java.lang.NoClassDefFoundError thrown while loading >>> gnu.io.RXTXCommDriver >>> no SPs available! >>> Available ports are: >>> >>> >>> >>> HERE IS THE WEIRD THING. On some Intel Macs, this setup works >>> properly. On others not -- we get the "nativeGetVersion" exception. >>> >>> Does anyone have any suggestions on for what to look for? >>> >> >> Soounds like some dependency is missing. Check that yours paths >> are correct or that the libs are in the default search path >> for the Java VM, that is for both the Java JARs and the native >> libs. >> >> Are they all the same system version and Java version? >> >> Andre >> From ajmas at sympatico.ca Thu Feb 1 15:43:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Feb 2007 17:43:29 -0500 Subject: [Rxtx] Error 0x5... In-Reply-To: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> Message-ID: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Hi, First question, what OS are you using? You talk of DLLs, but the paths suggest a Unix based system (if it is a Unix based library then 'shared library' is the better term :) . Given you are getting an access denied, some things to check out: - whether you can connect with other applications - whether your user has read access to the device Andre On 31-Jan-07, at 20:47 , wrote: > I have an application which connects to an embedded device via the > serial port. I was using Java Comm API, but a few months ago a > strange thing started to happen--if we unplugged the embedded device, > and then plug it back in, the Java application would go into an > infinite loop with an error message that was not part of my code--I > assume it was from the DLL or Java Comm API classes, but I am > uncertain. > > So, today I installed RXTX and tried it, and it does much the same > thing (although, to my surprise, it worked just by changing the import > statements--cool.). > > I get error message like this over and over again: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access is denied. > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > Access is denied > > I also get an IOException. I tried to catch the exception and > close the port when this happened, but that doesn't seem to work > because it seems to hang on the line of code where I try to close > the port. > > Here is a possible clue: I thought the error started out of the > blue, but I just found out that the device has been connected through > USB for several months. I was not told this until today, so I thought > the problem had to be with the hardware/software on the embedded > device, since my code had not changed. But since the change to using > the USB might have occurred around the same time, I am starting to > think this has something to do with it. I have no idea how that > works, > but I guess there is some driver that converts the serial to USB to > send and recieve. > > So, any ideas? > > > ------------------------------- > Chuck Cusack > Visiting Assistant Professor > Department of Computer Science > Hope College > 27 Graves Place > Holland, MI 49423 > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From gruhop-rxtx at yahoo.com Thu Feb 1 20:34:53 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Thu, 1 Feb 2007 19:34:53 -0800 (PST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: <866527.5517.qm@web55008.mail.re4.yahoo.com> I am using Windows XP. Not sure why the paths are showing in Unix style. Your second set of questions is not applicable--there aren't any access problems to the device under normal circumstances. It works just fine. It only fails when the device is unplugged and plugged back in. As far as connecting with other applications, this is a specialized embedded device, and my software is the only application designed to communicate with the device, so I cannot connect with other applications. Chuck. --- Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > > > I have an application which connects to an embedded device via the > > serial port. I was using Java Comm API, but a few months ago a > > strange thing started to happen--if we unplugged the embedded > device, > > and then plug it back in, the Java application would go into an > > infinite loop with an error message that was not part of my code--I > > assume it was from the DLL or Java Comm API classes, but I am > > uncertain. > > > > So, today I installed RXTX and tried it, and it does much the same > > thing (although, to my surprise, it worked just by changing the > import > > statements--cool.). > > > > I get error message like this over and over again: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > > Access is denied. > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): > > Access is denied > > > > I also get an IOException. I tried to catch the exception and > > close the port when this happened, but that doesn't seem to work > > because it seems to hang on the line of code where I try to close > > the port. > > > > Here is a possible clue: I thought the error started out of the > > blue, but I just found out that the device has been connected > through > > USB for several months. I was not told this until today, so I > thought > > the problem had to be with the hardware/software on the embedded > > device, since my code had not changed. But since the change to > using > > the USB might have occurred around the same time, I am starting to > > think this has something to do with it. I have no idea how that > > works, > > but I guess there is some driver that converts the serial to USB to > > send and recieve. > > > > So, any ideas? > > > > > > ------------------------------- > > Chuck Cusack > > Visiting Assistant Professor > > Department of Computer Science > > Hope College > > 27 Graves Place > > Holland, MI 49423 > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Feb 1 22:03:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:03:08 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> References: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> <3E0437DC-DA0E-40A6-9917-3BAC90AF48D8@sympatico.ca> Message-ID: The Unix paths are there because the windows dlls are built on Linux. This error is actually mentioned in another thread concerning too many error messages with USB Dongles/Bluetooth. On Thu, 1 Feb 2007, Andre-John Mas wrote: > Hi, > > First question, what OS are you using? You talk of DLLs, but the > paths suggest a Unix based system (if it is a Unix based library > then 'shared library' is the better term :) . > > Given you are getting an access denied, some things to check out: > - whether you can connect with other applications > - whether your user has read access to the device > > Andre > > On 31-Jan-07, at 20:47 , rxtx at yahoo.com> wrote: > >> I have an application which connects to an embedded device via the >> serial port. I was using Java Comm API, but a few months ago a >> strange thing started to happen--if we unplugged the embedded device, >> and then plug it back in, the Java application would go into an >> infinite loop with an error message that was not part of my code--I >> assume it was from the DLL or Java Comm API classes, but I am >> uncertain. >> >> So, today I installed RXTX and tried it, and it does much the same >> thing (although, to my surprise, it worked just by changing the import >> statements--cool.). >> >> I get error message like this over and over again: >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access is denied. >> >> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >> Access is denied >> >> I also get an IOException. I tried to catch the exception and >> close the port when this happened, but that doesn't seem to work >> because it seems to hang on the line of code where I try to close >> the port. >> >> Here is a possible clue: I thought the error started out of the >> blue, but I just found out that the device has been connected through >> USB for several months. I was not told this until today, so I thought >> the problem had to be with the hardware/software on the embedded >> device, since my code had not changed. But since the change to using >> the USB might have occurred around the same time, I am starting to >> think this has something to do with it. I have no idea how that >> works, >> but I guess there is some driver that converts the serial to USB to >> send and recieve. >> >> So, any ideas? >> >> >> ------------------------------- >> Chuck Cusack >> Visiting Assistant Professor >> Department of Computer Science >> Hope College >> 27 Graves Place >> Holland, MI 49423 >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 1 22:06:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Feb 2007 22:06:53 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <866527.5517.qm@web55008.mail.re4.yahoo.com> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: Hi Chuck We need to shut down rxtx in the native code when this happens. I just need to get to it. I'm planning on the next release in early March and this is one bug we need to address by then. The port vanished. RXTX was written assuming that ports are not removable. Serial cables, sure. But in this USB case its like taking chips off the motherboard as far as the original code is concerned. On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > I am using Windows XP. Not sure why the paths are showing in Unix > style. > > Your second set of questions is not applicable--there aren't any > access problems to the device under normal circumstances. It > works just fine. It only fails when the device is unplugged and > plugged back in. As far as connecting with other applications, > this is a specialized embedded device, and my software is the only > application designed to communicate with the device, so I cannot > connect with other applications. > > Chuck. > > --- Andre-John Mas wrote: > >> Hi, >> >> First question, what OS are you using? You talk of DLLs, but the >> paths suggest a Unix based system (if it is a Unix based library >> then 'shared library' is the better term :) . >> >> Given you are getting an access denied, some things to check out: >> - whether you can connect with other applications >> - whether your user has read access to the device >> >> Andre >> >> On 31-Jan-07, at 20:47 , > rxtx at yahoo.com> wrote: >> >>> I have an application which connects to an embedded device via the >>> serial port. I was using Java Comm API, but a few months ago a >>> strange thing started to happen--if we unplugged the embedded >> device, >>> and then plug it back in, the Java application would go into an >>> infinite loop with an error message that was not part of my code--I >>> assume it was from the DLL or Java Comm API classes, but I am >>> uncertain. >>> >>> So, today I installed RXTX and tried it, and it does much the same >>> thing (although, to my surprise, it worked just by changing the >> import >>> statements--cool.). >>> >>> I get error message like this over and over again: >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>> Access is denied. >>> >>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>> Access is denied >>> >>> I also get an IOException. I tried to catch the exception and >>> close the port when this happened, but that doesn't seem to work >>> because it seems to hang on the line of code where I try to close >>> the port. >>> >>> Here is a possible clue: I thought the error started out of the >>> blue, but I just found out that the device has been connected >> through >>> USB for several months. I was not told this until today, so I >> thought >>> the problem had to be with the hardware/software on the embedded >>> device, since my code had not changed. But since the change to >> using >>> the USB might have occurred around the same time, I am starting to >>> think this has something to do with it. I have no idea how that >>> works, >>> but I guess there is some driver that converts the serial to USB to >>> send and recieve. >>> >>> So, any ideas? >>> >>> >>> ------------------------------- >>> Chuck Cusack >>> Visiting Assistant Professor >>> Department of Computer Science >>> Hope College >>> 27 Graves Place >>> Holland, MI 49423 >>> >>> >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From vt at freehold.crocodile.org Fri Feb 2 01:18:12 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Fri, 02 Feb 2007 01:18:12 -0700 Subject: [Rxtx] Error 0x5... In-Reply-To: References: <866527.5517.qm@web55008.mail.re4.yahoo.com> Message-ID: <45C2F3C4.7020508@freehold.crocodile.org> Trent Jarvi wrote: > Hi Chuck > > We need to shut down rxtx in the native code when this happens. I just > need to get to it. I'm planning on the next release in early March and > this is one bug we need to address by then. The port vanished. RXTX was > written assuming that ports are not removable. Serial cables, sure. But > in this USB case its like taking chips off the motherboard as far as the > original code is concerned. > (just checking in, catching up, no flamebite intended) Any progress on introducing the concept of a removable device into Java serial API? Now that you have to specifically buy a USB to serial dongle to just get the serial port on a computer... --vt > On Thu, 1 Feb 2007 gruhop-rxtx at yahoo.com wrote: > > >> I am using Windows XP. Not sure why the paths are showing in Unix >> style. >> >> Your second set of questions is not applicable--there aren't any >> access problems to the device under normal circumstances. It >> works just fine. It only fails when the device is unplugged and >> plugged back in. As far as connecting with other applications, >> this is a specialized embedded device, and my software is the only >> application designed to communicate with the device, so I cannot >> connect with other applications. >> >> Chuck. >> >> --- Andre-John Mas wrote: >> >> >>> Hi, >>> >>> First question, what OS are you using? You talk of DLLs, but the >>> paths suggest a Unix based system (if it is a Unix based library >>> then 'shared library' is the better term :) . >>> >>> Given you are getting an access denied, some things to check out: >>> - whether you can connect with other applications >>> - whether your user has read access to the device >>> >>> Andre >>> >>> On 31-Jan-07, at 20:47 , >> rxtx at yahoo.com> wrote: >>> >>> >>>> I have an application which connects to an embedded device via the >>>> serial port. I was using Java Comm API, but a few months ago a >>>> strange thing started to happen--if we unplugged the embedded >>>> >>> device, >>> >>>> and then plug it back in, the Java application would go into an >>>> infinite loop with an error message that was not part of my code--I >>>> assume it was from the DLL or Java Comm API classes, but I am >>>> uncertain. >>>> >>>> So, today I installed RXTX and tried it, and it does much the same >>>> thing (although, to my surprise, it worked just by changing the >>>> >>> import >>> >>>> statements--cool.). >>>> >>>> I get error message like this over and over again: >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >>>> Access is denied. >>>> >>>> Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): >>>> Access is denied >>>> >>>> I also get an IOException. I tried to catch the exception and >>>> close the port when this happened, but that doesn't seem to work >>>> because it seems to hang on the line of code where I try to close >>>> the port. >>>> >>>> Here is a possible clue: I thought the error started out of the >>>> blue, but I just found out that the device has been connected >>>> >>> through >>> >>>> USB for several months. I was not told this until today, so I >>>> >>> thought >>> >>>> the problem had to be with the hardware/software on the embedded >>>> device, since my code had not changed. But since the change to >>>> >>> using >>> >>>> the USB might have occurred around the same time, I am starting to >>>> think this has something to do with it. I have no idea how that >>>> works, >>>> but I guess there is some driver that converts the serial to USB to >>>> send and recieve. >>>> >>>> So, any ideas? >>>> >>>> >>>> ------------------------------- >>>> Chuck Cusack >>>> Visiting Assistant Professor >>>> Department of Computer Science >>>> Hope College >>>> 27 Graves Place >>>> Holland, MI 49423 >>>> >>>> >>>> >>>> _______________________________________________ >>>> Rxtx mailing list >>>> Rxtx at qbang.org >>>> http://mailman.qbang.org/mailman/listinfo/rxtx >>>> >>> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070202/6e129dea/attachment-0021.html From tjarvi at qbang.org Fri Feb 2 05:18:19 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Feb 2007 05:18:19 -0700 (MST) Subject: [Rxtx] Error 0x5... In-Reply-To: <45C2F3C4.7020508@freehold.crocodile.org> References: <866527.5517.qm@web55008.mail.re4.yahoo.com> <45C2F3C4.7020508@freehold.crocodile.org> Message-ID: On Fri, 2 Feb 2007, Vadim Tkachenko wrote: > Trent Jarvi wrote: >> Hi Chuck >> >> We need to shut down rxtx in the native code when this happens. I just >> need to get to it. I'm planning on the next release in early March and >> this is one bug we need to address by then. The port vanished. RXTX was >> written assuming that ports are not removable. Serial cables, sure. But >> in this USB case its like taking chips off the motherboard as far as the >> original code is concerned. >> > > (just checking in, catching up, no flamebite intended) > > Any progress on introducing the concept of a removable device into Java > serial API? Now that you have to specifically buy a USB to serial dongle to > just get the serial port on a computer... > > --vt > Hi Vadim There has not been progress. My plans at the moment are to shut down the port and void the file descriptor when the errors show up. I have just had very little time to look at it. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Tue Feb 6 21:18:08 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Tue, 6 Feb 2007 23:18:08 -0500 Subject: [Rxtx] Serial port speed Message-ID: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Hello, I'm doing a simple data logger: I receive information from a serial port and store it with some kind of timestamp to analyse it later. However, using RXTX I only get something around 10 ms between readings of several bytes, which is too large for me. Is there any way to decrease this time? Maybe recompiling the binaries? By the way, I'm using Windows XP. Thank you Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070206/6ee78e04/attachment-0021.html From alwyn.schoeman at gmail.com Thu Feb 8 13:07:34 2007 From: alwyn.schoeman at gmail.com (Alwyn Schoeman) Date: Thu, 8 Feb 2007 22:07:34 +0200 Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux Message-ID: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Hi everyone, I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the modem fine and uses the acm driver resulting in a device /dev/ttyACM0. I have modified the source code so that this port is recognized and used as a serial port. Using minicom it works without problem. I've tried communicating with it using both Java (rxtx version 2.1) and python. In both scenarios I get the same result and I think I'm just doing something wrong. When using rxtx I am using the one example on your site (TwoWaySerialComms). I enter the data and send it to the serial device. The data I send echoes back. I'm not sure if I'm reading it or if it is the library. This is strange as I am quite sure that all echo settings are turned off. Then after a considerable time, an ERROR is returned from the device. It is as if it has either received garbage or timed out waiting for a complete command. Anyone please put me on the right path? -- Alwyn Schoeman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/3f9f3627/attachment-0021.html From juanmtamayo at gmail.com Thu Feb 8 13:22:01 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 15:22:01 -0500 Subject: [Rxtx] Windows XP Latency Message-ID: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Hello, Is there any way of reducing the elapsed time between the moment a byte is received and the listener is notified of a received byte? I'm jus writing a serial monitor that puts a timestamp to each received byte, but the resolution I get has not been enough. Thank you for your help, Juan Manuel Tamayo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070208/40bdb9fd/attachment-0021.html From tjarvi at qbang.org Thu Feb 8 18:32:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:32:24 -0700 (MST) Subject: [Rxtx] Windows XP Latency In-Reply-To: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> References: <8985cf7d0702081222h27d8014dm31ac9bdcc21e6261@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > Is there any way of reducing the elapsed time between the moment a byte is > received and the listener is notified of a received byte? > > I'm jus writing a serial monitor that puts a timestamp to each received > byte, but the resolution I get has not been enough. > > Thank you for your help, > Hi Juan There is not an easy way to tune this. You may look at the usleeps in the eventLoop code in SerialImp.c but that requires recompiling rxtx. From tjarvi at qbang.org Thu Feb 8 18:35:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:35:04 -0700 (MST) Subject: [Rxtx] Trouble interfacing to USB (acm) modem on Linux In-Reply-To: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> References: <22d55aea0702081207q5e7f6785l352d498d6f5f9fb1@mail.gmail.com> Message-ID: On Thu, 8 Feb 2007, Alwyn Schoeman wrote: > Hi everyone, > > I'm trying to use a Samba 75 GSM modem to send SMS. The linux picks up the > modem fine and uses the acm driver resulting in a device /dev/ttyACM0. > > I have modified the source code so that this port is recognized and used as > a serial port. > > Using minicom it works without problem. > > I've tried communicating with it using both Java (rxtx version 2.1) and > python. In both scenarios I get the same result and I think I'm just doing > something wrong. > When using rxtx I am using the one example on your site (TwoWaySerialComms). > > I enter the data and send it to the serial device. The data I send echoes > back. I'm not sure if I'm reading it or if it is the library. This is > strange as I am quite sure that all > echo settings are turned off. > > Then after a considerable time, an ERROR is returned from the device. It is > as if it has either received garbage or timed out waiting for a complete > command. > > Anyone please put me on the right path? > > Hi Alwyn You may look in the contrib directory that comes with the rxtx source for some example modem control examples. SimpleSnuV1.java is an example that gets the right responses from atz for instance. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Feb 8 18:42:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 8 Feb 2007 18:42:26 -0700 (MST) Subject: [Rxtx] Serial port speed In-Reply-To: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > Hello, > > I'm doing a simple data logger: I receive information from a serial port and > store it with some kind of timestamp to analyse it later. However, using > RXTX I only get something around 10 ms between readings of several bytes, > which is too large for me. > > Is there any way to decrease this time? Maybe recompiling the binaries? > > By the way, I'm using Windows XP. > Hi Juan 10 ms is about what I've observed. You could alter the source to not jump back and forth from Java and C but thats about the latency one can expect on Linux and Windows without tinkering. You will need to explore how much cpu utilization you are willing to give in exchange for slightly better times. In theory it could happen in several nano seconds but you have the OS schedualing and Java to think about which makes the 10 ms fairly reasonable. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Thu Feb 8 21:02:24 2007 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 8 Feb 2007 23:02:24 -0500 Subject: [Rxtx] Serial port speed In-Reply-To: References: <8985cf7d0702062018j27858867ne336a0afceb14681@mail.gmail.com> Message-ID: <8985cf7d0702082002x639d4d38y5797f2e92cfb6c2f@mail.gmail.com> Ok Trent, thanks. Juan On 2/8/07, Trent Jarvi wrote: > > On Tue, 6 Feb 2007, Juan Manuel Tamayo wrote: > > > Hello, > > > > I'm doing a simp